package d8_tttt;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class t1 {
    public static void main(String[] args) throws InterruptedException {
        List<String> gift = new ArrayList<>();
        String[] names ={"口红","衣服","书包","手表","皮带","鲜花"};
        Random r = new Random();
        for (int i = 0; i < 100; i++) {
            gift.add(names[r.nextInt(names.length)]+(i+1)+".gif");
        }
        System.out.println(gift);

        //抢礼物,创建线程对象
        draw xm = new draw(gift,"小明");
        draw xh = new draw(gift,"小红");
        xm.start();
        xh.start();

        xm.join();
        xh.join();

        System.out.println(xm.getCount());
        System.out.println(xh.getCount());



    }
}
